package com.cn.dai.exception.exceptionHandler;

import com.cn.dai.common.R;
import com.cn.dai.exception.BizException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler{
    @ExceptionHandler
    R bizException(BizException e){
        return R.fail(e.getErrorCode(),e.getMessage());
    }
}
